<?php
   include('libary/init_index.php');
   sql2();
   //DEL LOGIN
   $cmd="SELECT * FROM `login` WHERE session_id='".session_id()."'";
   $excute=mysql_query($cmd);
   while ($info=mysql_fetch_array($excute,MYSQL_ASSOC))
   {
	  $cmd="DELETE FROM `session` WHERE `userid`=".$info['user_id'];
	  mysql_query($cmd);
   }
   $cmd="DELETE FROM `login` WHERE session_id='".session_id()."'";
   mysql_query($cmd);
   sql();
   session_unset();
   header('location:/');
?>